import requests
url="http://www.baidu.com"
resp=requests.get(url)
print(resp.status_code)
print(resp.url)
print(resp.headers)
print(resp.encoding)
print(resp.cookies)
print(resp.text)


# 获取格式是json的对象
url="http://www.weather.com.cn/data/sk/101010100.html"
resp1=requests.get(url)
print(resp1.encoding)
print(resp1.json())